


register_japi [[
    native DzFrameBindWidget takes integer frame, widget u, real world_x, real world_y, real world_z, real screen_x, real screen_y, boolean fog_visible, boolean unit_visible, boolean dead_visible returns nothing 
    native DzFrameBindWorldPos takes integer frame, real world_x, real world_y, real world_z, real screen_x, real screen_y, boolean fog_visible returns nothing
    native DzFrameUnBind takes integer frame returns nothing
]]

--[[
绑定Frame${frame} 到单位${unit}的实时位置, 偏移世界坐标(X${X}, Y${Y}, Z${Z}) 偏移屏幕坐标(X${SX}, Y${SY}) 战争迷雾可见${fog_visible} 有单位视野可见${unit_visible} 单位死亡可见${dead_visible}
绑定后会清除控件锚点, 每帧设置控件中心坐标为 世界坐标+偏移 转屏幕坐标 +偏移后的位置, 超出屏幕，或者不满足条件的情况下会对控件隐藏, 在删除单位，或者删除控件前解除绑定
]]
local mt = ac.frame
print('平台坐标函数',japi.DzFrameBindWidget)
if japi.DzFrameBindWidget then

    function mt:bind_world(object)
        if self.removed then return end
        if not object then return end
        japi.DzFrameBindWidget(self.handle,object.handle,0,0,0, 0,0,0)
    end 

    function mt:unbind_world()
        if not self.world_widget then return end
        self.world_widget = nil 
        japi.DzFrameUnBind(self.handle)
    end

end